# Thumbnail View ServiceAPI / WebDrawer Plugin

## Overview
This plugin generates thumbnail renditions for image files attached to Records.  It contains both a ServiceAPI Plugin and an Event processor plugin and also a windows app to manually create thumbnails.
### ServiceAPI Plugin
Will return a thumbnail of an image either by generating it 'on the fly' or by returning the image that is stored against a child rendition of type Other1, if one exists.

### Event Processor plugin
Will generate thumbnail image renditions (of type Other1) for image files newly attached to Records.
### Manual thumbnail creation
Call the same code that is called by the event processor add-in but from a Windows application which allows thumbnail renditions to be created for a specific set of Records.

## Pre-requisites
*HPRM version*
HPRM 8.1.1.

## Release Code
While it is probably best to check-out and build this code yourself the executables are available from the Downloads section.  Look for Makethumbnails 80 and Thumbnails Plugin 80.


## Installation

### ServiceAPI
To install as a ServiceAPI plugin
1. Copy the file HP.HPTRIM.Samples.Thumbnails.dll to the ServiceAPI / WebDrawer bin folder
2. Update the pluginAssemblies in hptrmi.config (see example below).

### Event Processor Add-in
1. Copy the files HP.HPTRIM.Samples.Thumbnails.dll, HP.HPTRIM.Samples.Thumbnails.dll.config, and log4net.dll to the HPRM folder on the WGS.
2. Configure the custom event using the details below [see here for an example](http://integration.hprm.info/blog/2015/7/26/a-first-event-processor-add-in) 

### Maketumbnails EXE
Download Makethumbnails 80, extract the files to a folder and run the EXE.

## Example pluginAssemblies
```
  <pluginAssemblies>
    <add name="HP.HPTRIM.Samples.Thumbnails"/>
  </pluginAssemblies>
```  

## Custom Event Details
* Name: ThumbnailEvent
* Assembly Name: HP.HPTRIM.Samples.Thumbnails
* Class Name: HP.HPTRIM.Samples.Thumbnails.ThumbnailEvent 

